bitkeeper revision 1.778 (404f5c24HB4-3O5d1LoEBPgmh5h6tg)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 10 Mar 2004 18:19:16 +0000 (18:19 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 10 Mar 2004 18:19:16 +0000 (18:19 +0000)
Makefile:
  Create Xen interface symlink.
time.c, hypervisor-if.h, kernel.c:
  Fix shared_info to make CPU TSC arch-dependent.

extras/mini-os/kernel.c
extras/mini-os/time.c
xen/arch/i386/time.c
xen/include/hypervisor-ifs/arch-i386/hypervisor-if.h
xen/include/hypervisor-ifs/arch-x86_64/hypervisor-if.h
xen/include/hypervisor-ifs/hypervisor-if.h
xenolinux-2.4.25-sparse/arch/xeno/Makefile
xenolinux-2.4.25-sparse/arch/xeno/kernel/time.c

index 4af99cdd351952e41d53c699614f6877deb587c2..aa944f50c35e31a7c0266047821df7c2ead0190f 100644 (file)
@@ -109,8 +109,8 @@ void start_kernel(start_info_t *si)
         printk(" %lx", si->net_rings[i]);
     }; printk("\n");
     printk("  blk_ring:   0x%lx\n", si->blk_ring);
-#endif
     printk("  dom_id:     %ld\n",  si->dom_id);
+#endif
     printk("  flags:      0x%lx\n", si->flags);
     printk("  cmd_line:   %s\n",  si->cmd_line ? (const char *)si->cmd_line : "NULL");
 
index 12356b0a03284de6199a5e5723afa99a4d553c05..df3a62e4dde844ca1bffb89a807f1af915caf22f 100644 (file)
@@ -70,7 +70,7 @@ static void get_time_values_from_xen(void)
         rmb();
         shadow_tv.tv_sec    = HYPERVISOR_shared_info->wc_sec;
         shadow_tv.tv_usec   = HYPERVISOR_shared_info->wc_usec;
-        shadow_tsc_stamp    = HYPERVISOR_shared_info->tsc_timestamp;
+        shadow_tsc_stamp    = HYPERVISOR_shared_info->tsc_timestamp.tsc_bits;
         shadow_system_time  = HYPERVISOR_shared_info->system_time;
         rmb();
     }
@@ -167,7 +167,7 @@ void init_time(void)
     __cpu_khz = HYPERVISOR_shared_info->cpu_freq;
     cpu_khz = (u32) (__cpu_khz/1000);
 
-    rdtsc_bitshift = HYPERVISOR_shared_info->rdtsc_bitshift;
+    rdtsc_bitshift = HYPERVISOR_shared_info->tsc_timestamp.tsc_bitshift;
     cpu_freq       = HYPERVISOR_shared_info->cpu_freq;
 
     scale = 1000000LL << (32 + rdtsc_bitshift);
index 947408882d9fde0bc490c56de6a0ea60ed2d4b51..62763262476b3fb46ea4eaf44bdff2a16f78557f 100644 (file)
@@ -280,12 +280,10 @@ void update_dom_time(shared_info_t *si)
     si->time_version1++;
     wmb();
 
-    /* NB. These two values don't actually ever change. */
     si->cpu_freq       = cpu_freq;
-    si->arch.rdtsc_bitshift = rdtsc_bitshift;
-
+    si->tsc_timestamp.tsc_bitshift = rdtsc_bitshift;
+    si->tsc_timestamp.tsc_bits     = tsc_irq;
     si->system_time    = stime_irq;
-    si->tsc_timestamp  = tsc_irq;
     si->wc_sec         = xtime.tv_sec;
     si->wc_usec        = xtime.tv_usec;
     si->wc_usec       += (jiffies - wall_jiffies) * (1000000 / HZ);
index fefc24a6338248190664329eea40c41091ddd8bf..e3b32cb4b5d37d37579a2fb9760868a9bb9652fc 100644 (file)
@@ -86,13 +86,10 @@ typedef struct
     unsigned long ss;
 } execution_context_t;
 
-/*
- * Shared info specific to the architecture in question
- */
-typedef struct arch_shared_info_st {
-    unsigned int       rdtsc_bitshift;  /* tsc_timestamp uses N:N+31 of TSC. */
-} arch_shared_info_t;
-
+typedef struct {
+    unsigned long  tsc_bits;      /* 32 bits read from the CPU's TSC. */
+    unsigned int   tsc_bitshift;  /* 'tsc_bits' uses N:N+31 of TSC.   */
+} tsc_timestamp_t;
 
 /*
  * The following is all CPU context. Note that the i387_ctxt block is filled 
index 53354f9ddfa117f9bbf288ffb14dc011cfc20526..0a1101b314a9f240a2be350b83b5fe7df6262f4e 100644 (file)
@@ -85,14 +85,10 @@ typedef struct
     unsigned long ss;
 } execution_context_t;
 
-/*
- * Xen/guestos shared data -- pointer provided in start_info.
- * NB. We expect that this struct is smaller than a page.
- */
-typedef struct arch_shared_info_st {
-    unsigned int       rdtsc_bitshift;  /* tsc_timestamp uses N:N+31 of TSC. */
-} arch_shared_info_t;
-
+typedef struct {
+    unsigned long  tsc_bits;      /* 32 bits read from the CPU's TSC. */
+    unsigned int   tsc_bitshift;  /* 'tsc_bits' uses N:N+31 of TSC.   */
+} tsc_timestamp_t;
 
 /*
  * The following is all CPU context. Note that the i387_ctxt block is filled 
index 2d708a5a4f43d643a0040fc52b6c5fe9b713a468..afba398828739a4a3c53c665444911099ad09907 100644 (file)
@@ -209,7 +209,6 @@ typedef struct shared_info_st {
      * Time: The following abstractions are exposed: System Time, Clock Time,
      * Domain Virtual Time. Domains can access Cycle counter time directly.
      */
-
     u64                cpu_freq;        /* CPU frequency (Hz).               */
 
     /*
@@ -221,20 +220,17 @@ typedef struct shared_info_st {
      */
     unsigned long      time_version1;   /* A version number for info below.  */
     unsigned long      time_version2;   /* A version number for info below.  */
-    unsigned long      tsc_timestamp;   /* TSC at last update of time vals.  */
+    tsc_timestamp_t    tsc_timestamp;   /* TSC at last update of time vals.  */
     u64                system_time;     /* Time, in nanosecs, since boot.    */
     unsigned long      wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
     unsigned long      wc_usec;         /* Usecs 00:00:00 UTC, Jan 1, 1970.  */
-    
-    /* Domain Virtual Time */
-    u64                domain_time;
-       
+    u64                domain_time;     /* Domain virtual time, in nanosecs. */
+
     /*
      * Timeout values:
      * Allow a domain to specify a timeout value in system time and 
      * domain virtual time.
      */
-
     u64                wall_timeout;
     u64                domain_timeout;
 
@@ -247,7 +243,6 @@ typedef struct shared_info_st {
     net_idx_t net_idx[MAX_DOMAIN_VIFS];
 
     execution_context_t execution_context;
-    arch_shared_info_t arch;
 
 } shared_info_t;
 
index 041f2fc8cd6ecebc32bf9111a5b7bed817e32aab..e9822809e7e527c1144534cda9dbebb2e82bb644 100644 (file)
@@ -111,6 +111,9 @@ archclean:
        @$(MAKEBOOT) clean
 
 archmrproper:
+       rm -f include/asm-xeno/hypervisor-ifs/arch
 
 archdep:
+       rm -f include/asm-xeno/hypervisor-ifs/arch
+       ( cd include/asm-xeno/hypervisor-ifs ; ln -sf arch-$(SUBARCH) arch)
        @$(MAKEBOOT) dep
index 335756b050a616c8796cfd8be7529408f246580f..0d41748c8209c2916732768c76357bd3a8d382fe 100644 (file)
@@ -211,7 +211,7 @@ static void __get_time_values_from_xen(void)
         rmb();
         shadow_tv.tv_sec    = HYPERVISOR_shared_info->wc_sec;
         shadow_tv.tv_usec   = HYPERVISOR_shared_info->wc_usec;
-        shadow_tsc_stamp    = HYPERVISOR_shared_info->tsc_timestamp;
+        shadow_tsc_stamp    = HYPERVISOR_shared_info->tsc_timestamp.tsc_bits;
         shadow_system_time  = HYPERVISOR_shared_info->system_time;
         rmb();
     }
@@ -604,7 +604,7 @@ void __init time_init(void)
     xtime.tv_usec = HYPERVISOR_shared_info->wc_usec;
     processed_system_time = shadow_system_time;
 
-    rdtsc_bitshift      = HYPERVISOR_shared_info->rdtsc_bitshift;
+    rdtsc_bitshift      = HYPERVISOR_shared_info->tsc_timestamp.tsc_bitshift;
     cpu_freq            = HYPERVISOR_shared_info->cpu_freq;
 
     scale = 1000000LL << (32 + rdtsc_bitshift);